<template>
    <div>
        <br/>
        <br/>
        <br/>
        <myheader/>

        <div class="container">

            <div class="item_column">
                <div class="left"> 
                    
                    <left/>
                </div>

                <div class="right"> 

                    <van-uploader :after-read="afterRead"  icon="plus" type="primary" />导入

                    <br />
                    <button @click="daochu">导出</button>
                <right/>
                </div>

            </div>

        </div>
    </div>
</template>

<script>
import axios from 'axios'
import myheader from './myheader.vue'
import left from './left.vue'
import right from './right.vue'
export default{

    components: {
        'myheader':myheader,
        'left':left,
        'right':right,
    },
    data () {
        return {
            
        }
    },
    methods: {
        // 导入文件
        afterRead(file){

            // 声明表单
            let formData = new FormData()

            // 添加
            formData.append("file",file.file)

            // 发起请求
            axios({url:'upload',method:'post',data:formData}).then(res => {

                console.log(res)
            })
            
        },
        daochu(){
            axios({url:'download',method:'get'}).then(res => {

                console.log(res)
            })
        },
        

        
    },
}
</script>


<style>
@import url("../assets/style.css");
</style>